﻿jQuery.fn.extend({
    // 是否启用
    enable: function (value) {
        return value ? $(this).removeAttr("disabled") : $(this).attr("disabled", "disabled");
    },
    // 是否只读
    readonly: function (value) {
        return value ? $(this).removeAttr("readonly") : $(this).attr("readonly", "readonly");
    }
});

// post请求
jQuery.post = function (url, data, success, dataType) {
    $.ajax({
        url: url, type: 'POST', data: data, dataType: dataType,
        error: function (er) { if (er.status == 401) { top.location.href = er.statusText; } },
        success: function (result) { if ($.isFunction(success)) success(result); }
    });
};

$(function () {
    $(window).resize(function () { $(".right-content").css("min-height", $(window).height() - 211); });
    $(".right-content").css("min-height", $(window).height() - 211);
    $("#keyword").keypress(function (e) { if (e.which == 13) $(this).next().trigger("click"); });
});

